package com.ruoyi.common.utils.rtf;

import java.util.Dictionary;
import java.util.Hashtable;

/**
 * rtf转换时，部分Special Characters无法转义成正确的gbk编码，这里在使用RTFReader解析前，先将这些Special Characters转换成相应的gkb编码
 *
 */
public class TransKey {
    static Dictionary<String, String> textKeywords = null;
    static {
        textKeywords = new Hashtable<String, String>();
        //textKeywords.put("\\",         "\\");
        //textKeywords.put("{",          "{");
        //textKeywords.put("}",          "}");
        //textKeywords.put(" ",          "\u00A0");  /* not in the spec... */
        //textKeywords.put("~",          "\u00A0");  /* nonbreaking space */
        //textKeywords.put("_",          "\u2011");  /* nonbreaking hyphen */
        //textKeywords.put("bullet",     "\u2022");
        //textKeywords.put("emdash",     "\u2014");
        //textKeywords.put("emspace",    "\u2003");
        //textKeywords.put("endash",     "\u2013");
        //textKeywords.put("enspace",    "\u2002");
        textKeywords.put("\\\\ldblquote",  "\\\\'a1\\\\'b0");//
        textKeywords.put("\\\\lquote",     "\\\\'a1\\\\'ae");//
        //textKeywords.put("ltrmark",    "\u200E");
        textKeywords.put("\\\\rdblquote",  "\\\\'a1\\\\'b1");//
        textKeywords.put("\\\\rquote",     "\\\\'a1\\\\'af");//
        //textKeywords.put("rtlmark",    "\u200F");
        //textKeywords.put("tab",        "\u0009");
        //textKeywords.put("zwj",        "\u200D");
        //textKeywords.put("zwnj",       "\u200C");
      /* There is no Unicode equivalent to an optional hyphen, as far as
         I can tell. */
        //textKeywords.put("-",          "\u2027");
    }
}
